﻿namespace BloggerBackup
{
    using System;
    using System.Collections.Generic;

    [Serializable]
    public class BlogSetting
    {
        private List<BackupFormat> _backupFormats;
        private string _backupPath = "";
        private string _bloggerBlogID = "";
        private string _blogURL = "";
        private bool _changed;
        private string _description;
        private string _feedURL;
        private Guid _ID = Guid.NewGuid();
        private int _lastRestoredPostCount = 0;
        private DateTime _lastRestoredPostsOn = Conversions.ToDate("1/1/1900");
        private int _limit = 0;
        private int _maxEntries = 0;
        private DateTime _newestPostDate = Conversions.ToDate("1/1/1900");
        private bool _onlyNewPostsSince;
        private bool _overwriteExisting = false;
        private string _postURL = "";
        private bool _requiresLogIn = false;
        private bool _saveComments = false;
        private int _saveFormat = 0;
        private string _selfFeedURL = "";
        private ServiceTypes _serviceType = ServiceTypes.Blogger;
        private string _title;
        private string _userName = "";

        public List<BackupFormat> BackupFormats
        {
            get
            {
                return this._backupFormats;
            }
            set
            {
                this._backupFormats = value;
            }
        }

        public string BackupPath
        {
            get
            {
                return this._backupPath;
            }
            set
            {
                this._backupPath = value;
                this.Changed = true;
            }
        }

        public string BloggerBlogID
        {
            get
            {
                return this._bloggerBlogID;
            }
            set
            {
                this._bloggerBlogID = value;
            }
        }

        public string BlogURL
        {
            get
            {
                return this._blogURL;
            }
            set
            {
                this._blogURL = value;
                this.Changed = true;
            }
        }

        public bool Changed
        {
            get
            {
                return this._changed;
            }
            set
            {
                this._changed = value;
            }
        }

        public string Description
        {
            get
            {
                return this._description;
            }
            set
            {
                this._description = value;
                this.Changed = true;
            }
        }

        public string FeedURL
        {
            get
            {
                return this._feedURL;
            }
            set
            {
                this._feedURL = value;
                this.Changed = true;
            }
        }

        public Guid ID
        {
            get
            {
                return this._ID;
            }
        }

        public int LastRestoredPostCount
        {
            get
            {
                return this._lastRestoredPostCount;
            }
            set
            {
                this._lastRestoredPostCount = value;
                this.Changed = true;
            }
        }

        public DateTime LastRestoredPostsOn
        {
            get
            {
                return this._lastRestoredPostsOn;
            }
            set
            {
                this._lastRestoredPostsOn = value;
                this.Changed = true;
            }
        }

        public int Limit
        {
            get
            {
                return this._limit;
            }
            set
            {
                this._limit = value;
                this.Changed = true;
            }
        }

        public int MaxEntries
        {
            get
            {
                return this._maxEntries;
            }
            set
            {
                this._maxEntries = value;
                this.Changed = true;
            }
        }

        public DateTime NewestPostDate
        {
            get
            {
                return this._newestPostDate;
            }
            set
            {
                this._newestPostDate = value;
            }
        }

        public bool OnlyNewPostsSince
        {
            get
            {
                return this._onlyNewPostsSince;
            }
            set
            {
                this._onlyNewPostsSince = value;
                this.Changed = true;
            }
        }

        public bool OverwriteExisting
        {
            get
            {
                return this._overwriteExisting;
            }
            set
            {
                this._overwriteExisting = value;
                this.Changed = true;
            }
        }

        public string PostURL
        {
            get
            {
                return this._postURL;
            }
            set
            {
                this._postURL = value;
            }
        }

        public bool RequiresLogIn
        {
            get
            {
                return this._requiresLogIn;
            }
            set
            {
                this._requiresLogIn = value;
            }
        }

        public bool SaveComments
        {
            get
            {
                return this._saveComments;
            }
            set
            {
                this._saveComments = value;
                this.Changed = true;
            }
        }

        public int SaveFormat
        {
            get
            {
                return this._saveFormat;
            }
            set
            {
                this._saveFormat = value;
                this.Changed = true;
            }
        }

        public string SelfFeedURL
        {
            get
            {
                return this._selfFeedURL;
            }
            set
            {
                this._selfFeedURL = value;
            }
        }

        public ServiceTypes ServiceType
        {
            get
            {
                return this._serviceType;
            }
            set
            {
                this._serviceType = value;
                this.Changed = true;
            }
        }

        public string Title
        {
            get
            {
                return this._title;
            }
            set
            {
                this._title = value;
                this.Changed = true;
            }
        }

        public string UserName
        {
            get
            {
                return this._userName;
            }
            set
            {
                this._userName = value;
                this.Changed = true;
            }
        }

        [Serializable]
        public class BackupFormat
        {
            private Guid _backupFormatTypeID;
            private string _backupPath;
            private SelectedSaveNameOptions _saveNameOptions;

            public Guid BackupFormatTypeID
            {
                get
                {
                    return this._backupFormatTypeID;
                }
                set
                {
                    this._backupFormatTypeID = value;
                }
            }

            public string BackupPath
            {
                get
                {
                    return this._backupPath;
                }
                set
                {
                    this._backupPath = value;
                }
            }

            public SelectedSaveNameOptions SaveNameOptions
            {
                get
                {
                    return this._saveNameOptions;
                }
                set
                {
                    this._saveNameOptions = value;
                }
            }
        }

        public enum ServiceTypes
        {
            Blogger
        }
    }
}

